#pragma once

#ifdef _FORCE_LEGACY_WIN32_API

#define lstrcatA(s1,s2) strcat(s1,s2)
#define lstrcmpA(s1,s2) strcmp(s1,s2)
#define lstrcmpiA(s1,s2) stricmp(s1,s2)
#define lstrcpyA(s1,s2) strcpy(s1,s2)
#define lstrcpynA(s1,s2,n) strncpy(s1,s2,n)
#define lstrlenA(s) strlen(s)
#define lstrcatW(s1,s2) wcscat(s1,s2)
#define lstrcmpW(s1,s2) wcscmp(s1,s2)
#define lstrcmpiW(s1,s2) wcsicmp(s1,s2)
#define lstrcpyW(s1,s2) wcscpy(s1,s2)
#define lstrcpynW(s1,s2,n) wcsncpy(s1,s2,n)
#define lstrlenW(s) wcslen(s)

#define GlobalAlloc(p1,p2) HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,p2)
#define GlobalFree(p) HeapFree(GetProcessHeap(),0,p)
#define GlobalLock(p) return p;
#define GlobalUnlock(p) return TRUE;

#define LocalAlloc GlobalAlloc
#define LocalFree GlobalFree
#define LocalLock GlobalLock
#define LocalUnlock GlobalUnlock

#define Sleep(x) SleepEx(x,FALSE)
#define WaitForSingleObject(p1,p2) WaitForSingleObjectEx(p1,p2,FALSE)
#define InitializeCriticalSection(p) InitializeCriticalSectionEx(p,0,CRITICAL_SECTION_NO_DEBUG_INFO)
#define LoadLibraryW(x) LoadPackagedLibrary(x,0)
#define CopyFileW(p1,p2,p3) CopyFile2(p1,p2,NULL)
#define MoveFileW(p1,p2) MoveFileExW(p1,p2,MOVEFILE_REPLACE_EXISTING)
#define GetTickCount GetTickCount64
#define timeGetTime GetTickCount64

#endif